package it.avantsoft.ls.peer.command;

import it.avantsoft.ls.peer.PeerHandler;

public class NewBrotherABCommand extends PeerCommand {
    private String id;
    private int port;

    public NewBrotherABCommand(PeerHandler peerHandler, String id, int port) {
        super(peerHandler);
        this.id = id;
        this.port = port;
    }

    public void execute() {
        getPeer().addCentralPeer(id, port);
        getPeer().signalNewUncle(id, port);
    }

    public String toString() {
        return "NewBrotherABCommand{" +
                "id='" + id + '\'' +
                ", port=" + port +
                '}';
    }
}
